package com.yjc.springyjcdemo.service;

import com.yjc.springyjcdemo.dao.YjcTestDao;
import com.yjc.springyjcdemo.entity.YjcTest;
import com.yjc.springyjcdemo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:shishumin
 * @Date:2021/11/20
 */
@Service
public class TestService {

    @Autowired
    private YjcTestDao yjcTestDao;
    public List<YjcTest> getList() {

        List<YjcTest> yjcTests = yjcTestDao.selectList();
        return yjcTests;
    }

    public Result insert(YjcTest yjcTest) {
        yjcTestDao.insertSelective(yjcTest);
        return Result.ok();
    }

    public YjcTest get(int id) {
        return yjcTestDao.selectByPrimaryKey(id);
    }
}
